package com.yiqi.liebang.feature.mine.view.adapter;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.suozhang.framework.framework.AM;
import com.yiqi.liebang.R;
import com.yiqi.liebang.entity.bo.QuestionBo;
import com.yiqi.liebang.entity.bo.UserCenterBo;

public class EducationAdapter extends BaseQuickAdapter<UserCenterBo.EducationAuthenticationBean, BaseViewHolder> {
    boolean isShow=false;boolean isLookMe=false;

    public EducationAdapter(boolean isShow,boolean isLookMe) {
        super(R.layout.item_userinfo_jiaoyu);
        this.isShow = isShow;
        this.isLookMe=isLookMe;
    }

    @Override
    protected void convert(BaseViewHolder helper, UserCenterBo.EducationAuthenticationBean item) {
        helper.setVisible(R.id.btn_userinfo_education_edit, isShow)
                .addOnClickListener(R.id.btn_userinfo_education_edit)
                .addOnClickListener(R.id.btn_userinfo_education_renzheng)
                .setVisible(R.id.iv_show_isrz,item.getStatus()==1?true:false)
                .setText(R.id.tv_edu_name, item.getSchoolName())
                .setText(R.id.tv_edu_date, item.getBeginTime() + " - " + item.getEndTime() + " ," +
                        " " + item.getSubjectName() + " , " + item.getDiploma());

        AM.image().bindToCircleObject(item.getEduLogo(),helper.getView(R.id.iv_edu_logos));

        if (item.getStatus() == 1 && !isShow||!isLookMe) {  //已认证
            helper.getView(R.id.btn_userinfo_education_renzheng).setVisibility(View.GONE);
        } else if (item.getStatus() == 0 && isShow&&isLookMe){
            helper.getView(R.id.btn_userinfo_education_renzheng).setVisibility(View.VISIBLE);
        }
    }
}
